<template>
	<view class="box">
		<view class="header">
			<view class="">
				{{data.name}}{{data.building_number}}幢/栋{{data.unit_number}}单元{{data.floor}}楼{{data.ventricle_number}}室{{data.room_number}}房号
			</view>
		</view>
		<view class="card_head">
			<view class="column">
				租客姓名: {{data.tenant_name}}
			</view>
			<view class="flexBetween">
				<view class="column">
					联系电话:{{data.tenant_phone}}
				</view>
			</view>
		</view>
		<view class="module">
			<view class="card">
				<view class="title_">
					账期{{data.bill_period}}
				</view>
				<view class="row">
					<view class="title">
						应收款日
					</view>
					<view class="data">
						{{data.receivable_date}}
					</view>
				</view>
				<view class="row">
					<view class="title">
						实收款日
					</view>
					<view class="data">
						{{data.actual_date}}
					</view>
				</view>
				<view class="title_">
					应收明细
				</view>
				<view class="row">
					<view class="title">
						租金(1个月)
					</view>
					<view class="data">
						{{data.receivable_amount}}
					</view>
				</view>
				<view class="title_">
					应收总计
				</view>
				<view class="row">
					<view class="titlered">
						应收总计
					</view>
					<view class="data red">
						{{data.receivable_amount}}
					</view>
				</view>
				<!-- 	<view class="row">
					<view class="titlered">
						剩余待打定金
					</view>
					<view class="data red">
						￥0.00
					</view>
				</view> -->
				<view class="row">
					<view class="title">
						收款渠道
					</view>
					<view class="data">
						{{data.collection_channel || '线下支付'}}
					</view>
				</view>
				<!-- 	<view class="row">
					<view class="title_">
						账单备注
					</view>
					<view class="data" @click="remark">
						<view>
							租金01/09/08
						</view>
						<u-icon name="arrow-right" color="#2979ff" size="18"></u-icon>
					</view>
					
					</view> -->
			</view>
		</view>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	import {
		getSelectHouseBillDetail
	} from "@/api/my/index.js";
	export default {
		data() {
			return {
				name: '亲子新',
				data: {}
			}
		},
		onLoad(optien) {
	 
			this.selectHouseBillDetail(optien.id)
		 
		},
		methods: {
			async selectHouseBillDetail(id) {
				const res = await getSelectHouseBillDetail(id)
			 
				if (res.data.code == 200) {
					this.data = res.data.data[0]
				 
				} else {
					this.$refs.uToast.show({
						message: res.data.msg,
						type: 'error'
					})
				}

			},
			remark() {
				uni.navigateTo({
					url: '../../../public/lease/remark',
					animationType: this.animation.type,
					animationDuration: this.animation.time
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import "~@/styles/index.scss";
	@import "~@/styles/global.scss";

	.box {
		background-color: $pagebgc;
		min-height: 100vh;
		padding: 10rpx;
		max-height: 100%;
		box-sizing: border-box;
		font-size: 32rpx;

		.header {
			margin-top: 20rpx;
			background-color: #4d89cb;
			padding: 30rpx;
			color: #fff;
			border-radius: 20rpx 20rpx 0 0;

			.title {
				@include textOverflow;
			}
		}

		.card_head {
			padding: 10rpx 30rpx;
			background-color: #fff;
			border-bottom: #dcdcdc solid 1rpx;

			.column {
				margin: 20rpx 0;
				width: 70%;
			}

			.flexBetween {
				@include flexBetween;
			}
		}

		.module {
			.title_ {
				font-weight: bold;
			}

			.titlered {
				color: red;
			}

			.red {
				color: red;
			}

			.card {
				padding: 30rpx;
				margin-top: 20rpx;
				background-color: #fff;
			}

			.row {
				@include flexBetween;
				padding: 20rpx 0;
			}

			.title {
				color: $noimportant;
			}

			.data {
				display: flex;
				align-items: center;
			}

			.contract {
				display: flex;
				align-items: center;
				margin: 20rpx 0;
			}
		}
	}
</style>